#!/bin/bash
import pymssql


class MSSQL:
    def __init__(self):
        conn = pymssql.connect(server='*', user='*', password='*', database='vc')
        self.cursor = conn.cursor()
        self.cursor.execute('select NAME, FREE_SPACE, CAPACITY from [dbo].[VPXV_DATASTORE]')
        # self.row = cursor.fetchone()

    def get_storage(self):
        storage = []
        row = self.cursor.fetchone()
        while row:
            storage.append(row)
            row = self.cursor.fetchone()
        return storage


if __name__ == "__main__":
    mssql = MSSQL()
    for data in mssql.get_storage():
        if 'DB' in data[0]:
            print(data[0])